객체지향 코드 연습(hughryu1125)#2
Open
hughryu1125 wants to merge 5 commits intoyunjin1213:mainfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 개요
구입 금액 입력부터 로또 발행, 당첨 통계 및 수익률 계산까지의 전체 흐름을 MVC 패턴으로 구현했습니다. 각 객체의 역할을 분리하고 도메인 로직을 캡슐화하는 데 집중했습니다.
✨ 주요 구현 내용
로또 도메인 및 검증: 1~45 사이 중복 없는 랜덤 번호 6개 생성 로직 구현 및 입력값 검증(1,000원 단위, 숫자, 중복 여부 등)을 완료했습니다.
당첨 통계 및 수익률 계산: Rank Enum을 활용해 등수를 판별하고, Calculator와 Service를 통해 총 당첨금 및 수익률 계산 로직을 구현했습니다.
UI 구현: 요구사항에 맞춘 사용자 입력 프롬프트 및 발행 내역, 당첨 결과 출력 뷰를 구현했습니다.
💡 고민 중인 부분 (TODO)
다음 리팩토링에서 개선하고자 고민 중인 사항들입니다.
Lotto와 WinningLotto 간의 유사한 속성과 검증 로직 추상화 처리
AppConfig 도입을 통한 객체 생성 및 의존성 주입(DI) 관리
Service에 있는 determineRank 로직을 도메인(Rank 등) 내부로 이동하여 책임 분리